#include <iostream>
using namespace std;

int main()
{
	int x, flag = 0;
	cin >> x;
	if(x % 2 == 0)
		flag++;
	if(x > 4 && x <= 12)
		flag++;
	cout << (flag == 2 ? 1 : 0) << " ";
	cout << (flag >= 1 ? 1 : 0) << " ";
	cout << (flag == 1 ? 1 : 0) << " ";
	cout << (flag == 0 ? 1 : 0) << endl;
	return 0;
}
